import 'package:flutter/material.dart';
import 'package:plugins/http/http.dart';

class DioExample extends StatefulWidget {
  @override
  _DioExampleState createState() => _DioExampleState();
}

class _DioExampleState extends State<DioExample> {
  void getHttp() async {
    http(
      url: "https://www.bjbcdc.com.cn/authc-restapi/v1/user/auth/login",
      params: {"tel": "18816820401", "password": "1111"},
      requestCallBack: (statusCode, data, error) {
        print(data);
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("DioExample"),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          getHttp();
        },
        child: Text("GO"),
      ),
    );
  }
}
